package cate.common.table.activity.throne;


import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.d.GDThrone;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("淘汰赛轮次")
public class TBKoRoundRow extends ERow {

    @NoteField("轮次")
    public int round;

    @NoteField("比赛类型")
    public int gameType;

    @NoteField("开始天数")
    public int openDay;

    @NoteField("开始时间")
    public String timeStr;

    @NoteField("竞猜时间")
    public long betTime;

    @NoteField("战斗时间")
    public long fightTime;

    @NoteField("战斗场次")
    public int bestOfNum;

    @NoteField("匹配规则")
    public int matchRule;

    @NoteField("赛区数量")
    public int zoneNum;

    @NoteField("单个赛区最大分组数")
    public int zoneGroupNum;


    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("轮次", 0);
        this.round = xrw.getInteger("轮次", 0);
        this.gameType = xrw.getInteger("比赛类型", GDThrone.KoGameType.DIVIDE);
        this.openDay = xrw.getInteger("开始天数", 0);
        this.timeStr = xrw.getString("开始时间");
        this.betTime = xrw.getLong("竞猜时间",0L)*1000;
        this.fightTime = xrw.getLong("战斗时间",0L)*1000;
        this.bestOfNum = xrw.getInteger("战斗场次", 1);
        this.matchRule = xrw.getInteger("匹配规则", GDThrone.MatchRule.R0);
        this.zoneNum = xrw.getInteger("赛区数量", 1);
        this.zoneGroupNum = xrw.getInteger("单个赛区最大分组数",1);
    }

    public int winTime;

    @Override
    public void decode() {
        winTime = bestOfNum / 2 + 1;
    }
}
